package com.bobamrz.model;


public class Camera {
	
	private int id;
	private String model;
	private double sensorResolutionInMegapixels;
	private String description;
	
	
	
	public Camera(int id, String model, double sensorResolutionInMegapixels,
			String description) {
		super();
		this.id = id;
		this.model = model;
		this.sensorResolutionInMegapixels = sensorResolutionInMegapixels;
		this.description = description;
	}
	
	public Camera(String[] formFields) {
		id = Integer.parseInt(formFields[0]);
		model = formFields[1];
		sensorResolutionInMegapixels = Double.parseDouble(formFields[2]);
		description = formFields[3];
	}
	
	/**
	 * @return {id, model, resolution, description}
	 */
	public String[] getFieldArray() {
		String[] fields = new String[4];
		fields[0] = id+"";
		fields[1] = model;
		fields[2] = sensorResolutionInMegapixels+"";
		fields[3] = description;
		return fields;
	}
	
	@Override
	public String toString() {
		return id+" "+""+model+" "+description+" "+sensorResolutionInMegapixels;
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getModel() {
		return model;
	}
	public void setModel(String model) {
		this.model = model;
	}
	public double getSensorResolutionInMegapixels() {
		return sensorResolutionInMegapixels;
	}
	public void setSensorResolutionInMegapixels(double sensorResolutionInMegapixels) {
		this.sensorResolutionInMegapixels = sensorResolutionInMegapixels;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	
	
	
	

}
